package minimips.isa.rtype;

import minimips.computer.Computer;

public class SltInstruction extends RegisterWritingRTypeInstruction {

	public SltInstruction(long memoryAddress, int rs, int rt,
			int rd, int extra) {
		super(memoryAddress, 0, "SLT", rs, rt, rd, extra, 42);
	}

	@Override
	protected int getDestinationRegister() {
		return this.getOpcode() >> 11 & 31;
	}

	@Override
	protected long executeAluOperation(Computer computer) {
		long sltResult = computer.getId_ex_a().getRegisterValue() < computer.getId_ex_b().getRegisterValue() ? 1 : 0;
		return sltResult;
	}

	

}
